home *** CD-ROM | disk | FTP | other *** search
/ Aminet 39 / Aminet 39 (2000)(Schatztruhe)[!][Oct 2000].iso / Aminet / util / misc / DelfInit.lha / DelfInit / Install < prev    next >
Encoding:
Text File  |  2000-08-02  |  11.0 KB  |  283 lines

  1. ;-----------------------------------------------------------------------------
  2. ; TITLE        : Install
  3. ; VERSION      : 1.0
  4. ; DATE         : 28.08.1999
  5. ; DESCRIPTION  : Installer script for DelfInit
  6. ; INPUT        : -
  7. ; OUTPUT       : -
  8. ;-----------------------------------------------------------------------------
  9. ; MODIFICATIONS:
  10. ; 19.07.2000 Modification
  11. ;  Installation texts updated
  12. ;
  13. ; 31.07.2000 Modification
  14. ;  Installation texts updated
  15. ;-----------------------------------------------------------------------------
  16. ; LIMITATIONS AND BUGS
  17. ; 28.08.1999 Limitation
  18. ;  Doesn't install DelfInit command call to the user-startup file
  19. ;-----------------------------------------------------------------------------
  20.  
  21. ; $VER: Install 1.0 (28.08.1999)
  22.  
  23. ;-----------------------------------------------------------------------------
  24. ; VARIABLES VARIABLES VARIABLES VARIABLES VARIABLES VARIABLES VARIABLES VARIA
  25. ;-----------------------------------------------------------------------------
  26. (set #config_ok 1)                       ; Default: configuration is ok
  27. (set #cpu "???(20|30|40|60)")            ; Required CPU
  28. (set #installer_ver 43)                  ; Minimum Installer version
  29. (set #installer_rev 3)                   ; Minimum Installer revision
  30. (set #os_ver 40)                         ; Minimum OS version
  31. (set #os_rev 10)                         ; Minimum OS revision
  32. (set #appsize 1000000)                   ; Required diskspace for application
  33.                                          ; (bytes)
  34. (set #configcheckmask %001)              ; Configuration check mask:
  35.                                          ; bit0 (right)  = cpu
  36.                                          ; bit1 (middle) = os version
  37.                                          ; bit2 (left)   = disk space
  38. (set #application "DelfInit")            ; Application
  39.  
  40. ; Default language (English)
  41. (set #string1 ("\nInstaller version %ld.%ld required.\nPlease check your configuration." #installer_ver #installer_rev))
  42. (set #string2 ("\n%s\n\nCopyright © 1999-2000 Janne Peräaho.\nAll Rights Reserved." #application))
  43. (set #string3 ("\n%s has now been installed.\nRead DelfInit.guide for instructions how to autoinitialize Delfina." #application))
  44. (set #string4 "\nAt least 68020 CPU, Installer version 43.3 and delfina.library required.\n\nPlease check your configuration.")
  45. (set #string5 "\nSelect components to be installed.")
  46. (set #string50 "\nSOFTWARE COMPONENTS\n\nDelfInit package consists of binary executable (DelfInit) and Amiga guide documentation (DelfInit.guide).\n\nIn this section you may select the prefered software components to be installed.")
  47. (set #string51 "DelfInit      (about 14 kB)")
  48. (set #string52 "Documentation (about 20 kB)")
  49. (set #string60 "\nSelect target directory for DelfInit (Delfina/bin directory recommended).")
  50. (set #string61 "\nINSTALLING DELFINIT\n\nDelfInit command will be copied to the selected directory.")
  51. (set #string62 "C:Delfina/bin/")
  52. (set #string63 "\nSelect target directory for DelfInit documentation (Delfina/Docs directory recommended).")
  53. (set #string64 "\nINSTALLING DELFINIT DOCUMENTATION\n\nDelfInit.guide and it's icon will be copied to the selected directory.")
  54. (set #string65 "C:Delfina/Docs")
  55. (set #string70 "\nInstalling DelfInit...")
  56. (set #string71 "\nINSTALLING DELFINIT\n\nDelfInit command will be copied into the target directory.")
  57. (set #string72 "DelfInit")
  58. (set #string73 "#?")
  59. (set #string74 "\nInstalling DelfInit documentation...")
  60. (set #string75 "\nINSTALLING DOCUMENTATION\n\nDelfInit.guide and DelfInit.guide.info will be copied into the target directory.")
  61. (set #string76 "")
  62. (set #string77 "DelfInit(.guide|.guide.info)")
  63.  
  64. ; Finnish language
  65. (if (= @language "suomi")
  66.    (
  67.       (set #string1 ("\nAsennukseen tarvitaan Installer-ohjelman versio %ld.%ld." #installer_ver #installer_rev))
  68.       (set #string2 ("\n%s\n\nOhjelmiston oikeudet © 1999-2000 omistaa Janne Peräaho.\nKaikki oikeudet pidätetään." #application))
  69.       (set #string3 ("\n%s on nyt asennettu.\nJos haluat aktivoida Delfinan automaattisesti jokaisen käynnistyksen yhteydessä, lue asennusohjeet DelfInit-dokumentaatiosta (DelfInit.guide)." #application))
  70.       (set #string4 "\nDelfInit vaatii vähintään 68020 CPU:n, Installer (versio 43.3) -ohjelman ja delfina-kirjaston.")
  71.       (set #string5 "\nValitse ne ohjelmiston osat, jotka haluat asentaa.")
  72.       (set #string50 "\nOHJELMISTON OSAT\n\nDelfInit-paketti koostuu ajokelpoisesta binääritiedostosta (DelfInit) ja Amiga guide -formaatissa olevasta dokumentaatiosta (DelfInit.guide).\n\nVoit valita haluamasi ohjelmiston osat, jotka asennetaan.")
  73.       (set #string51 "DelfInit      (noin 14 kt)")
  74.       (set #string52 "Dokumentaatio (noin 20 kt)")
  75.       (set #string60 "\nValitse kohdehakemisto DelfInit-ohjelmalle (suositus: Delfina/bin-hakemisto).")
  76.       (set #string61 "\nDELFINIT:N ASENNUS\n\nDelfInit-komento kopioidaan valittuun hakemistoon.")
  77.       (set #string62 "C:Delfina/bin/")
  78.       (set #string63 "\nValitse kohdehakemisto DelfInit-dokumentaatiolle (suositus: Delfina/Docs-hakemisto).")
  79.       (set #string64 "\nDELFINIT-DOKUMENTAATION ASENNUS\n\nDelfInit.guide ja sen ikoni kopioidaan valittuun hakemistoon.")
  80.       (set #string65 "C:Delfina/Docs")
  81.       (set #string70 "\nDelfInit:n asennus...")
  82.       (set #string71 "\nDELFINIT:N ASENNUS\n\nDelfInit-komento kopioidaan kohdehakemistoon.")
  83.       (set #string72 "DelfInit")
  84.       (set #string73 "#?")
  85.       (set #string74 "\nDelfInit-dokumentaation asennus...")
  86.       (set #string75 "\nDOKUMENTAATION ASENNUS\n\nDelfInit.guide ja DelfInit.guide.info kopioidaan kohdehakemistoon.")
  87.       (set #string76 "")
  88.       (set #string77 "DelfInit(.guide|.guide.info)")
  89.    )
  90. ); if
  91.  
  92. ;-----------------------------------------------------------------------------
  93. ; SUBROUTINES SUBROUTINES SUBROUTINES SUBROUTINES SUBROUTINES SUBROUTINES SUB
  94. ;-----------------------------------------------------------------------------
  95. ;-----------------------------------------------------------------------------
  96. ; TITLE        : p_DecodeVersion
  97. ; VERSION      : 0.10
  98. ; DATE         : 30.08.1998
  99. ; DESCRIPTION  : Get version and revision from raw version number
  100. ; INPUT        : #version - raw version number
  101. ; OUTPUT       : #ver     - version number
  102. ;                #rev     - revision number
  103. ;-----------------------------------------------------------------------------
  104. ; MODIFICATIONS: -
  105. ;-----------------------------------------------------------------------------
  106. (procedure p_DecodeVersion #version
  107.    (set #ver (/ #version 65536))
  108.    (set #rev (- #version (* #ver 65536)))
  109. )
  110.  
  111. ;-----------------------------------------------------------------------------
  112. ; TITLE        : p_EncodeVersion
  113. ; VERSION      : 0.10
  114. ; DATE         : 30.08.1998
  115. ; DESCRIPTION  : Create raw version number from version and revision number
  116. ; INPUT        : #ver     - version number
  117. ;                #rev     - revision number
  118. ; OUTPUT       : #version - raw version number
  119. ;-----------------------------------------------------------------------------
  120. ; MODIFICATIONS: -
  121. ;-----------------------------------------------------------------------------
  122. (procedure p_EncodeVersion #ver #rev
  123.    (set #version (+ (* #ver 65536) #rev))
  124. )
  125.  
  126. ;-----------------------------------------------------------------------------
  127. ; TITLE        : p_CheckConfiguration
  128. ; VERSION      : 0.10
  129. ; DATE         : 30.08.1998
  130. ; DESCRIPTION  : Check if requirements match with current configuration
  131. ; INPUT        : -
  132. ; OUTPUT       : #config_ok - 0=not ok, 1=ok
  133. ;-----------------------------------------------------------------------------
  134. ; MODIFICATIONS: -
  135. ;-----------------------------------------------------------------------------
  136. (procedure p_CheckConfiguration
  137.  
  138.    ; Variables
  139.    (set #config_ok 1)
  140.  
  141.    ; Check CPU
  142.    (if (in #configcheckmask 0)
  143.       (
  144.          (if (not (patmatch #cpu (database "cpu")))
  145.             (
  146.                (set #config_ok 0)
  147.             )
  148.          ); if
  149.       )
  150.    ); if
  151.  
  152.    ; Check OS version
  153.    (if (in #configcheckmask 1)
  154.       (
  155.          (p_EncodeVersion #os_ver #os_rev)
  156.          (if (< #version (getversion))
  157.             (set #config_ok 0)
  158.          ); if
  159.       )
  160.    ); if
  161.  
  162.    ; Check diskspace
  163.    (if (in #configcheckmask 2)
  164.       (
  165.          (set #availdspace (getdiskspace @default-dest))
  166.          ; Information not available
  167.          (if (not (< #availdspace 0))
  168.             ; Not enough room
  169.             (if (< #availdspace #appsize)
  170.                (set #config_ok 0)
  171.             ); if
  172.          ); if
  173.       )
  174.    ); if
  175.  
  176. ); p_CheckConfiguration
  177.  
  178. ;-----------------------------------------------------------------------------
  179. ; TITLE        : p_GetDestination
  180. ; VERSION      : 0.10
  181. ; DATE         : 30.08.1998
  182. ; DESCRIPTION  : Get destination directory
  183. ; INPUT        : -
  184. ; OUTPUT       : @default-dest
  185. ;-----------------------------------------------------------------------------
  186. ; MODIFICATIONS: -
  187. ;-----------------------------------------------------------------------------
  188. (procedure p_GetDestination #d1string #d2string #d3string
  189.  
  190.    (set @default-dest
  191.       (askdir
  192.          (prompt #d1string)
  193.          (help #d2string)
  194.          (default #d3string)
  195.          (disk)
  196.       ); askdir
  197.    )
  198. ); p_GetDestination
  199.  
  200. ;-----------------------------------------------------------------------------
  201. ; TITLE        : p_CopyFiles
  202. ; VERSION      : 0.10
  203. ; DATE         : 30.08.1998
  204. ; DESCRIPTION  : Copy files
  205. ; INPUT        : -
  206. ; OUTPUT       : -
  207. ;-----------------------------------------------------------------------------
  208. ; MODIFICATIONS: -
  209. ;-----------------------------------------------------------------------------
  210. (procedure p_CopyFiles #c1string #c2string #c3string #c4string
  211.  
  212.    (copyfiles
  213.       (prompt #c1string)
  214.       (help #c2string)
  215.       (source #c3string)
  216.       (dest @default-dest)
  217.       (pattern #c4string)
  218.       (optional "force")
  219.    ); copyfiles
  220.  
  221. ); p_CopyFiles
  222.  
  223. ;-----------------------------------------------------------------------------
  224. ; MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN
  225. ;-----------------------------------------------------------------------------
  226. ; Welcome message
  227. (welcome #string2)
  228.  
  229. ; Check Installer version
  230. (p_EncodeVersion #installer_ver #installer_rev)
  231. (if (< @installer-version #version)
  232.    (
  233.       (exit #string1 (quiet))
  234.    )
  235. ); if
  236.  
  237. ; Ask options
  238. (set #installoptions
  239.    (askoptions
  240.       (prompt #string5)
  241.       (help #string50)
  242.       (choices #string51 #string52)
  243.       (default %11)
  244.    ); askoptions
  245. )
  246.  
  247. ; First option (#string51)
  248. (if (in #installoptions 0)
  249.    (
  250.       ; Get destination directory
  251.       (p_GetDestination #string60 #string61 #string62)
  252.  
  253.       ; Check configuration
  254.       (p_CheckConfiguration)
  255.       (if (< #config_ok 1)
  256.          (exit #string4 (quiet))
  257.       ); if
  258.  
  259.       ; Copy files
  260.       (p_CopyFiles #string70 #string71 #string72 #string73)
  261.    )
  262. ); if
  263.  
  264. ; Second option (#string52)
  265. (if (in #installoptions 1)
  266.    (
  267.       ; Get destination directory
  268.       (p_GetDestination #string63 #string64 #string65)
  269.  
  270.       ; Check configuration
  271.       (p_CheckConfiguration)
  272.       (if (< #config_ok 1)
  273.          (exit #string4 (quiet))
  274.       ); if
  275.  
  276.       ; Copy files
  277.       (p_CopyFiles #string74 #string75 #string76 #string77)
  278.    )
  279. ); if
  280.  
  281. ; All done
  282. (exit #string3 (quiet))
  283.